package com.qf.demo;

import com.qf.service.AdminService;
import com.qf.service.impl.AdminServiceImpl;

/**
 * @Description: 公用常量
 * @Data: 2022/8/27 16:30
 * @Pacakge: com.qf.demo
 * @ClassName: AdminTest
 * @Author: fan
 * 管理员测试
 */
public class AdminTest {
    public static void main(String[] args) {
        for (int i = 0 ;i<5;i++){
            //从打印结果 我们看出每次创建了一个新的adminDao
            //是多例的,性能上没有的优化
            AdminService adminService = new AdminServiceImpl();
            adminService.addAdmin();
        }

        for (int i = 0;i<5;i++){
            //单例
            AdminService adminService = new AdminServiceImpl();
            adminService.addAdmin();
        }


    }
}
